package scm.erp.sale.plan.domain;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import org.apache.poi.hpsf.Decimal;
import scm.erp.core.domain.CommonFields;
import scm.erp.core.domain.IConvert;
import scm.erp.core.mybatis.interceptor.annotation.UUID;
import scm.erp.sale.plan.enums.PlanStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class Plan {

    /**
     * 实体
     */
    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class Entity
            extends CommonFields
            implements IConvert {
        @UUID
        private String id;
        private String planCode;
        private String planType;
        private String customerName;
        private String customerCode;
        private String freightName;
        private String freightCode;
        private Float salesNumber;
        private BigDecimal salesAmount;
//        private String time;
        private String site;
        private PlanStatus status;


        public PlanStatus getStatus() {
            if (status==null){
                return PlanStatus.ENABLE;
            }
            return status;
        }
    }

    /**
     * 实体继承
     */
    @EqualsAndHashCode(callSuper = true)
    @Data
    public static class Vo extends Entity {

    }

    /**
     * 编码搜索
     */
    @Data
    public static class searchPlanCodeVo{
        private String planCode;
    }
    @Data
    public static class searchCustomerNameVo{
        private String customerName;
    }
    @Data
    public static class searchFreightNameVo{
        private String freightName;
    }

    /**
     * 查询
     */
    @Data
    public static class SearchVo {
        private String id;
        private String planCode;
        private String customerName;
        private String freightName;
        private PlanStatus status;
        private Integer deleteFlag;
    }
//    @Data
//    public static class ExcelExportVo implements IConvert{
//        @ExcelProperty("品系")
//        private String seriesName;
//        @ExcelProperty("编码")
//        private String seriesCode;
//        @ExcelProperty("创建人")
//        private String createUser;
//        @ExcelProperty("创建时间")
//        private LocalDateTime createTime;
//        @ExcelProperty("状态")
//        private String statusName;
//        @ExcelIgnore
//        private PlanStatus status;
//        @ExcelProperty("备注")
//        private String remark;
//        public String getStatusName(){
//            if (status!=null){
//                return status.getName();
//            }
//            return statusName;
//        }
//    }
//    @Data
//    public static class ExcelVo implements IConvert{
//        @ExcelProperty("父级品系")
//        private String pid;
//        @ExcelProperty("品系名称")
//        private String seriesName;
//        @ExcelProperty("品系编码")
//        private String seriesCode;
//        @ExcelProperty("备注")
//        private String remark;
//    }


}
